package com.ysd.user.utils;

public class PageUtil {
	
	
		//limit setValue,limit
		private Integer setValue;  //需要你自己写的limit setValue,limit
		private Integer limit;  //每页显示多少条，jsp传过来的limit
		private Integer page;  //第几页，jsp传过来的page
		
		public Integer getSetValue() {
			setValue = (page-1)*limit;
			return setValue;
		}
		
		public void setSetValue(Integer setValue) {
			this.setValue = setValue;
		}
		
		public Integer getLimit() {
			return limit;
		}

		public void setLimit(Integer limit) {
			this.limit = limit;
		}

		public Integer getPage() {
			return page;
		}

		public void setPage(Integer page) {
			this.page = page;
		}

		@Override
		public String toString() {
			return "PageVo [setValue=" + setValue + ", limit=" + limit + "]";
		}

		public PageUtil(Integer page,Integer limit) {
			super();
			this.limit = limit;
			this.page = page;
		}

		public PageUtil() {
			super();
		}
		
		
		/**
		 * 用于方便使用分页功能
		 * @param page
		 * @param limit
		 * @return
		 */
		public static Integer getSetValue(Integer page,Integer limit) {
			PageUtil pageUtil = new PageUtil(page,limit);
			return pageUtil.getSetValue();
		}
	
	
}
